import request from '@/utils/request'
import { commonList, commonAdd, commonEdit, commonBatchDelete, commonDetail } from '../_common'

//api controller根路径，前后不带 /
const controller = 'media-ai';

export function getOcrList(fileId) {
  return request({
    url: `/${controller}/ocr/${fileId}`,
    method: 'get',
  })
}

export function getAudioList(fileId) {
  return request({
    url: `/${controller}/audio/${fileId}`,
    method: 'get',
  })
}

export function getSmartList(fileId) {
  return request({
    url: `/${controller}/smart/${fileId}`,
    method: 'get',
  })
}

export function getShotTimeList(fileId) {
  return request({
    url: `/media/${fileId}/shotTime`,
    method: 'get',
  })
}

export function addShotTime(fileId, params) {
  return request({
    url: `/media/${fileId}/shotTime`,
    method: 'put',
    params
  })
}

export function saveShotTime(fileId, catalogId) {
  return request({
    url: `/media/${fileId}/shotTime/${catalogId}`,
    method: 'post'
  })
}

export function deleteSmartErr(smartId) {
  return request({
    url: `/media-ai/smart/delete/${smartId}`,
    method: 'get',
  })
}

export function deleteOcrErr(errId) {
  return request({
    url: `/media-ai/ocr/deleteErr/${errId}`,
    method: 'get',
  })
}

export function deleteAudioErr(errId) {
  return request({
    url: `/media-ai/audio/deleteErr/${errId}`,
    method: 'get',
  })
}

export function replaceOcrErr(ocrId, errId) {
  return request({
    url: `/media-ai/ocr/replace/${ocrId}/${errId}`,
    method: 'get',
  })
}

export function replaceAudioErr(audioId, errId) {
  return request({
    url: `/media-ai/audio/replace/${audioId}/${errId}`,
    method: 'get',
  })
}

export function getAiCategory() {
  return request({
    url: `/media-ai/getAiCategory`,
    method: 'get',
  })
}

export function addOcrErr(data) {
  return request({
    url: `/media-ai/ocr/addErr`,
    method: 'post',
    data
  })
}

export function addAudioErr(data) {
  return request({
    url: `/media-ai/audio/addErr`,
    method: 'post',
    data
  })
}

export function addSmartErr(data) {
  return request({
    url: `/media-ai/smart/add`,
    method: 'post',
    data
  })
}

export function addOcrText(data) {
  return request({
    url: `/media-ai/ocr/add`,
    method: 'post',
    data
  })
}

export function getDocPic(fileId, filePage) {
  return request({
    url: `/media-ai/getDocPic/${fileId}/${filePage}`,
    method: 'get',
  })
}

export function review(fileId) {
  return request({
    url: `/media-ai/review/${fileId}`,
    method: 'get',
  })
}

export function renameShotTime(id, name) {
  return request({
    url: `/media/${id}/shotTime/rename?shotName=${name}`,
    method: 'put',
  })
}

export function deleteShotTime(id) {
  return request({
    url: `/media/${id}/shotTime`,
    method: 'delete',
  })
}
